package com.jerei.plugin.service.impl;

import com.jerei.utils.condition.ConditionEntity;
import com.jerei.utils.spring.PageBean;
import com.jerei.plugin.dao.I${entityName}Dao;
import com.jerei.plugin.entity.${entityName};
import com.jerei.plugin.service.I${entityName}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created by sunfeihu on 2016/10/21.
 */
@Service
public class ${entityName}ServiceImpl implements I${entityName}Service {

    @Autowired
    private I${entityName}Dao i${entityName}Dao;

    @Override
    public ${entityName} save(${entityName} entity) {
        return i${entityName}Dao.save(entity);
    }

    @Override
    public int delete(Long id) {
        return i${entityName}Dao.delete(id);
    }

    @Override
    public int update(${entityName} entity) {
        return i${entityName}Dao.update(entity);
    }

    @Override
    public ${entityName} find(Long id) {
        return i${entityName}Dao.find(id);
    }


    @Override
    public void save(List<${entityName}> list){
        i${entityName}Dao.save(list);
    }

    @Override
    public void delete(List<Long> ids){
        i${entityName}Dao.delete(ids);
    }

    @Override
    public void update(List<${entityName}> list){
        i${entityName}Dao.update(list);
    }

    @Override
    public PageBean<${entityName}> page(int nowPage, int pageSize, ConditionEntity conditionEntity) {
        return i${entityName}Dao.page(nowPage, pageSize, conditionEntity);
    }
}
